#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;


int mem[201][201];

int getMoneyAmount(int n) {
    return dfs(1, n);
}

int dfs(int left, int right)
{
    if (left >= right)
        return 0;
    if (mem[left][right] != 0)
        return mem[left][right];

    int ret = INT_MAX;
    for (int i = left; i <= right; ++i)
    {
        int x = dfs(left, i - 1);
        int y = dfs(i + 1, right);

        ret = min(ret, i + max(x, y));
    }

    mem[left][right] = ret;
    return ret;
}

int main()
{

	return 0;
}